package dealer.models
{
	import dealer.Global;
	import dealer.events.CustomEvent;
	
	import flash.display.MovieClip;
	import flash.events.NetDataEvent;
	import flash.events.NetStatusEvent;
	import flash.net.NetConnection;

	public class ModelsLogin extends MovieClip
	{
		private var eventCustom:CustomEvent;
		public var _message:String="do login";
		private var nc:NetConnection;
		
		public function ModelsLogin()
		{
			super();
		}
		/* do check submit login button */
		public function doCheckSubmitLogin():void
		{
			eventCustom=new CustomEvent("onSubmitLogin");
			eventCustom.message=_message;
			dispatchEvent(eventCustom);
		}
		/* do submit login */
		public function doSubmitLogin(_user:String):void
		{
			//eventCustom=new CustomEvent("onSubmitLogin");
			eventCustom.message=_message;						
			//dispatchEvent(eventCustom);			
			/* connection */
			nc=new NetConnection();
			nc.client=this;
			nc.connect(Global.RTMP);
			nc.addEventListener(NetStatusEvent.NET_STATUS,onStatus);
		}
		/* comment function */
		private function onStatus(event:NetDataEvent):void
		{
			
		}
	}
	/* End Class */
}